Hi, |
Re: I need to check the access rights for different attributes in DXL scripting Something like this:
Module modHandle = current
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{ valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
NameAD = ad.name
if (inheritedVal == false)
{
valueRes = inheritedVal(modHandle, attrDef)
if (null valueRes) //
then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessVal: " valueRes
}
defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef)
if (inheritedDef == false)
{
defRes = inheritedDef(modHandle, attrDef)
if (null defRes ) //
then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessDef: " defRes
}
}
|
Re: I need to check the access rights for different attributes in DXL scripting llandale - Thu Feb 14 14:34:47 EST 2013 Something like this:
Module modHandle = current
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{ valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
NameAD = ad.name
if (inheritedVal == false)
{
valueRes = inheritedVal(modHandle, attrDef)
if (null valueRes) //
then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessVal: " valueRes
}
defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef)
if (inheritedDef == false)
{
defRes = inheritedDef(modHandle, attrDef)
if (null defRes ) //
then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessDef: " defRes
}
}
|
Re: I need to check the access rights for different attributes in DXL scripting llandale - Thu Feb 14 14:34:47 EST 2013 Something like this:
Module modHandle = current
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{ valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
NameAD = ad.name
if (inheritedVal == false)
{
valueRes = inheritedVal(modHandle, attrDef)
if (null valueRes) //
then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessVal: " valueRes
}
defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef)
if (inheritedDef == false)
{
defRes = inheritedDef(modHandle, attrDef)
if (null defRes ) //
then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
else print NameAD "\tFAILURE setting AccessDef: " defRes
}
}
I checked it now. I had lot of errors. Moreover I don need to do it for all the Attributes and Type. I should be able to do only for certain attributes of my choice. For eg: I should be able to declare it in array(For certain attributes) Could you please help me out. Regards, Shriraam |
Re: I need to check the access rights for different attributes in DXL scripting SystemAdmin - Fri Feb 15 06:29:53 EST 2013 I found the error myself. The error is because I am trying to check the access rights even for the non boolean value. Eg:Absolute Number. Can you please let me know how to do checking only for certain attributes. Thanks a lot in advance. Regards, Shriraam |
Re: I need to check the access rights for different attributes in DXL scripting |
Re: I need to check the access rights for different attributes in DXL scripting SystemAdmin - Fri Feb 15 06:53:19 EST 2013 OK, I am just scribbling not trying to run the code. You'll need to debug it yourself.
Skip skpCheckTheseAttrs = createString() // KEY and DATA both 'string' NameAttr
put(skpCheckTheseAttrs,"MyFirstAttr")
put(skpCheckTheseAttrs,"MySecondAttr")
//*****************************************
void MakeInherited(Module in_mod, string in_NameAttr)
{
bool inheritedVal, inheritedDef
string ErrMess
AttrDef ad
ad = find(in_mod, in_NameAttr)
if (null ad)
{ print "Cannot find attr *" in_NameAttr "* in module '" name(in_mod) "'\n"
return()
}
ErrMess = isAccessInheritedVal(in_mod,ad,inheritedVal)
if (inheritedVal == false)
{
ErrMess = inheritedVal(in_mod, ad)
if (null ErrMess) //
then print in_NameAttr "\tSUCCESS! AccessVal is now INHERITED!\n"
else print in_NameAttr "\tFAILURE setting AccessVal: " ErrMess // ErrMess already has trailing '\n'
}
ErrMess = isAccessInheritedDef(in_mod,ad,inheritedDef)
if (inheritedDef == false)
{
ErrMess = inheritedDef(in_mod, attrDef)
if (null ErrMess ) //
then print in_NameAttr "\tSUCCESS! AccessDef is now INHERITED!\n"
else print in_NameAttr "\tFAILURE setting AccessDef: " ErrMess
}
} // end MakeInherited()
|
Re: I need to check the access rights for different attributes in DXL scripting llandale - Fri Feb 15 11:06:57 EST 2013 OK, I am just scribbling not trying to run the code. You'll need to debug it yourself.
Skip skpCheckTheseAttrs = createString() // KEY and DATA both 'string' NameAttr
put(skpCheckTheseAttrs,"MyFirstAttr")
put(skpCheckTheseAttrs,"MySecondAttr")
//*****************************************
void MakeInherited(Module in_mod, string in_NameAttr)
{
bool inheritedVal, inheritedDef
string ErrMess
AttrDef ad
ad = find(in_mod, in_NameAttr)
if (null ad)
{ print "Cannot find attr *" in_NameAttr "* in module '" name(in_mod) "'\n"
return()
}
ErrMess = isAccessInheritedVal(in_mod,ad,inheritedVal)
if (inheritedVal == false)
{
ErrMess = inheritedVal(in_mod, ad)
if (null ErrMess) //
then print in_NameAttr "\tSUCCESS! AccessVal is now INHERITED!\n"
else print in_NameAttr "\tFAILURE setting AccessVal: " ErrMess // ErrMess already has trailing '\n'
}
ErrMess = isAccessInheritedDef(in_mod,ad,inheritedDef)
if (inheritedDef == false)
{
ErrMess = inheritedDef(in_mod, attrDef)
if (null ErrMess ) //
then print in_NameAttr "\tSUCCESS! AccessDef is now INHERITED!\n"
else print in_NameAttr "\tFAILURE setting AccessDef: " ErrMess
}
} // end MakeInherited()
|